package com.oo.polymorphic_4.house;

import java.util.Scanner;

/**
 * HouseTest--${description}
 *
 * @author: Jovi
 * @createTime: 2017-05-09 17:55
 **/
public class HouseTest {

    public static void main(String[] args) {

        Villa v = new Villa("清凉别墅", 300, "八达岭", 300, 3);

        Building b = new Building("中信花园", 200, "北四环", 200, 3);

        House hh = null;

        System.out.println("请选择需要购买的房子：（1.别墅，2.楼房）");
        Scanner sc = new Scanner(System.in);
        int id = sc.nextInt();
        if (id == 1) {
            hh = v;
        } else {
            hh = b;
        }

        hh.buy();
    }
}
